package com.loanpcase;

import java.io.*;

import com.util.GzipUtil;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.util.HashMap;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;


import com.util.HttpSend;
import com.alibaba.fastjson.JSONObject;

public class RLDJ0007 extends LPCase{


	@Override
	protected String getRequestUrl() {
		return "/RLMS/RLDJ0007";
	}

	public Map<String,Object> getRequestData(){
		HashMap<String,Object> REQUESTDATA = new HashMap<String, Object>();
		REQUESTDATA.put("REQSYSID","501");
		REQUESTDATA.put("PLATID","000");
		REQUESTDATA.put("DOCKING_ORGNO","00002");
		REQUESTDATA.put("COOPER_CODE","90002");
		REQUESTDATA.put("APPLY_NO","AL153248966848200000000000000000");
		REQUESTDATA.put("LOAN_APPLY_NO","AL153248966848200000000000000000");
		REQUESTDATA.put("FILENAME","AL1531726339345.zip");
		REQUESTDATA.put("FILE", GzipUtil.fileToString(new File("d:/aaa.zip")));
		return REQUESTDATA;
		
	}

	static public void main(String[] args){
		new RLDJ0007().run(Config.TEST_CONTEXT_URL_1601);

	}

	public static void readZipFile(String file) throws Exception {
		//ZipFile zf = new ZipFile(file);
		ZipArchiveInputStream is = new ZipArchiveInputStream(new BufferedInputStream(new ByteArrayInputStream(new BASE64Decoder().decodeBuffer(file))));
		ZipArchiveEntry entry = null;
		int i = 0;
		while ((entry = is.getNextZipEntry()) != null) {

			if (!entry.isDirectory()) {
				i++;
			}
		}
		System.out.println(i);
	}



	}
